//
//  Extension_UIColor.swift
//  BusinessApp
//
//  Created by liaozhenming on 2016/12/20.
//  Copyright © 2016年 KangCunTouZi. All rights reserved.
//

import UIKit

extension UIImage {
    
    class func imageWithColor(color: UIColor, imageHeight: CGFloat) -> UIImage {
        let rect = CGRect(x:0.0,y:0.0,width:1.0,height:imageHeight)
        UIGraphicsBeginImageContext(rect.size)
        let content = UIGraphicsGetCurrentContext()
        content!.setFillColor(color.cgColor)
        content?.fill(rect)
        let image = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()
        return image!
    }
}
